package erz.printing.police;

import android.content.Intent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class JieJingActivity extends BaseActivity implements View.OnClickListener {

    private View tiaojieEntry;
    private View jiabaoEntry;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jie_jing);

        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);

        initView();
    }

    @Override
    public boolean onSupportNavigateUp() {
        finish();
        return true;
    }

    private void initView() {
        tiaojieEntry = findViewById(R.id.tiaojie_entry);
        jiabaoEntry = findViewById(R.id.jiabao_entry);

        tiaojieEntry.setOnClickListener(this);
        jiabaoEntry.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.tiaojie_entry) {
            Intent intent = new Intent(this, PrintPhotoActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("checkTitle", "现场调解");
            bundle.putString("docTemplateNotice", "pdf/调解协议书.pdf");
            bundle.putString("noticeName", "调解协议书");
            bundle.putString("title", "现场调解");
            bundle.putBoolean("printTitle", true);
            intent.putExtras(bundle);
            startActivity(intent);
        }
        else if (view.getId() == R.id.jiabao_entry) {
            Intent intent = new Intent(this, PrintPhotoActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("checkTitle", "反家暴告诫");
            bundle.putString("docTemplateNotice", "pdf/家庭暴力告诫书.pdf");
            bundle.putString("noticeName", "家庭暴力告诫书");
            bundle.putString("title", "反家暴告诫");
            bundle.putBoolean("printTitle", true);
            intent.putExtras(bundle);
            startActivity(intent);
        }
    }
}
